<?php
namespace App\Http\Controllers\CmsApi;

use Illuminate\Http\Request;
use App\Http\Model\Hint;
use App\Lib\Response;
use App\Http\Controllers\BaseController;
use App\Http\Services\MsgServices;
use App\Http\Services\RoomMsgServices;

class InnerMsgController extends BaseController
{
    private $msgService;
    private $roomMsgService;

    public function __construct(){
        $this->msgService = new MsgServices();
        $this->roomMsgService = new RoomMsgServices();
    }

    /**
     * 留言板通知
     */
    public function lybMsgSend(Request $request){
        $fromUserId = $request->input('fromUserId');
        $toUserId = $request->input('toUserId');
        $msg = $request->input('msg');
        $createTime = $request->input('createTime');
        $endTime = $request->input('endTime');
        $jumpUrl = $request->input('jumpUrl');
        $imgUrl = $request->input('imgUrl');
        if(empty($fromUserId) || empty($toUserId) || empty($msg)) {
            Response::returnResult(Hint::PARAM_ERROR);
        }
        $this->msgService->lybMsgSend($fromUserId, $toUserId, $msg, $createTime, $endTime, $jumpUrl, $imgUrl);

        Response::returnResult(Hint::SUCCESS);
    }

}
